import request from "@/utils/request";
import qs from "qs";

// 查询列的基本信息列表
export function queryTableColumnList(query) {
  return request({
    url: "/datascan/b/dbscanresult/queryTableColumnList",
    method: "get",
    params: query,
  });
}
//查询敏感字段
export function querySensitiveWordsList(query) {
  return request({
    url: "/system/b/redissensitivedata/querySensitiveWordsList",
    method: "get",
    params: query,
  });
}
//敏感字段下拉
export function querySensitiveAllWordsList(query) {
  return request({
    url: "/datascan/b/redissensitivedata/queryAllSensitiveWordsList",
    method: "get",
    params: query,
  });
}
// 查询列的基本信息列表
export function queryColumnList(query) {
  return request({
    url: "/datascan/b/dbscanresult/queryColumnList",
    method: "get",
    params: query,
  });
}

// 查询数据库类型列表
export function queryListByTypeCode(data) {
  return request({
    url: "/datascan/b/dbscanresult/queryListByTypeCode",
    method: "post",
    headers: {
      "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
    },
    data: qs.stringify({
      dataDictTypeCode: "SYS_DB_TYPE_",
    }),
  });
}

// 查询列的基本信息列表
export function updateColumnApprove(data) {
  return request({
    url: "/datascan/b/dbscanresult/update",
    method: "post",
    headers: {
      "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
    },
    data: qs.stringify(data),
  });
}

//

// 查询列的基本信息详细
export function getInfo(scanResultId) {
  return request({
    url: "/datascan/info/" + scanResultId,
    method: "get",
  });
}

// 新增列的基本信息
export function addInfo(data) {
  return request({
    url: "/datascan/info",
    method: "post",
    data: data,
  });
}

// 编辑列的基本信息
export function updateInfo(data) {
  return request({
    url: "/datascan/info",
    method: "put",
    data: data,
  });
}

// 删除列的基本信息
export function delInfo(scanResultId) {
  return request({
    url: "/datascan/info/" + scanResultId,
    method: "delete",
  });
}

// 绑定重要数据
export function updateImpData(query) {
  return request({
    url: "/datascan/b/dbscanresult/updateImpData",
    method: "get",
    params: query,
  });
}
// 绑定核心数据
export function updateCoreData(query) {
  return request({
    url: "/datascan/b/dbscanresult/updateCoreData",
    method: "get",
    params: query,
  });
}
// 绑定识别规则
export function updateDiserRule(query) {
  return request({
    url: "/datascan/b/dbscanresult/updateDiserRule",
    method: "get",
    params: query,
  });
}
